import request from '@/config/axios'
import { DataComparisonRespVO } from '@/api/universal/statistics/common'

export interface VLogStatisticsVO {
  id: number
  day: string
  vlogId: number
  vlogName: string
  vlogCoverUrl: string
  browseCount: number
  browseUserCount: number
  likedCount: number
  favoriteCount: number
}

// 视频统计 API
export const VLogStatisticsApi = {
  // 获得视频统计分析
  getVLogStatisticsAnalyse: (params: any) => {
    return request.get<DataComparisonRespVO<VLogStatisticsVO>>({
      url: '/vlog/statistics/analyse',
      params
    })
  },
  // 获得视频状况明细
  getVLogStatisticsList: (params: any) => {
    return request.get<VLogStatisticsVO[]>({
      url: '/vlog/statistics/list',
      params
    })
  },
  // 导出获得视频状况明细 Excel
  exportVLogStatisticsExcel: (params: any) => {
    return request.download({
      url: '/vlog/statistics/export-excel',
      params
    })
  },
  // 获得视频排行榜分页
  getVLogStatisticsRankPage: async (params: any) => {
    return await request.get({
      url: `/vlog/statistics/rank-page`,
      params
    })
  }
}
